//
//  LayerCard.h
//  lhq
//
//  Created by codin on 14-7-24.
//
//

#ifndef __lhq__LayerCard__
#define __lhq__LayerCard__

#include "cocos2d.h"
#include "pomelo.h"
#include "GamePlayer.h"





struct PosBaseData
{
	PosBaseData(int s_row=0,int s_col=0)
	{
		row=s_row;
		col=s_col;
	};
	int row;
	int col;
};
class CardBlock;
class Card;
class LayerCard : public cocos2d::Layer {
public:
	LayerCard();
	~LayerCard();

	//LayerCard(Node *parent,VecCard &cardIndx);


    static cocos2d::Scene* createScene();
    
    virtual bool init();
    void onEnter();

	void setParent(Node *parent);
	void setVec(int* cardIndx);

	void fixVec();
	void addMyBlockCards();
	Rect getCardPosition();

	int getCardTag(int colnum,int row);
	int getCardZorder(int colnum,int row);
	int getQueBlock();
	//static create(Node *parent,VecCard &cardIndx);


	bool onTouchBegan(Touch* touch, Event* event);
	void onTouchMoved(Touch* touch, Event* event);
	void onTouchEnded(Touch* touch, Event* event);
	int getTouchCard(CCPoint* p);
	PosBaseData LayerCard::getTouchInfo(CCPoint* p);

    CREATE_FUNC(LayerCard);

	Node *m_Parent;
	//VecCard m_CardMgr;
	int m_CardMgr[PAOHUZI_MAX_CARD_INDEX];

	VecBlock m_BlockMgr;

	Card *m_TouchCard;
	//int cardWidth;
	//int cardHeight;
};


#endif /* defined(__lhq__LayerCard__) */
